<?
    if (!isset($_SESSION['logged'])) {
?>
<script type="text/javascript" Language="JavaScript">
    <!--
    function Blank_TextField_Validator2()
    {
        // Check the value of the element
        // from the form
        if (document.signupform.name.value == ""){
            // If null display and alert box
            alert("Please fill in the name field.");
            // Place the cursor on the field for revision
            document.signupform.name.focus();
            // return false to stop further processing
            return (false);
        }
        if (document.signupform.email.value == ""){
            alert("Please fill in the e-mail field.");
            document.signupform.email.focus();
            return (false);
        }
        if (document.signupform.newpassword.value == ""){
            alert("Please fill in the new password field.");
            document.signupform.newpassword.focus();
            return (false);
        }
        if (document.signupform.repeatnewpassword.value == ""){
            alert("Please fill in the repeat new password field.");
            document.signupform.repeatnewpassword.focus();
            return (false);
        }
        if (document.signupform.newpassword.value != document.signupform.repeatnewpassword.value){
            alert("The new password does not match with the repeated one.");
            document.signupform.newpassword.select();
            return (false);
        }
        // If text_name is not null continue processing
        return (true);
    }
    -->
</script>
<div id="mainCol" class="clearfix">
    <h3 id="why">Sign up</h3>
    <ul id="maincon">
        <li class="clearfix last">
            <fieldset id="forms">
            <table width="100%">
                <form method="post" name="signupform" action="?url=signuping" onsubmit="return Blank_TextField_Validator2()">
                    <tr>
                        <td width="25%">Name: </td>
                        <td><input type="text" id="f_input" name="name" size="55" /></td>
                    </tr>
                    <tr>
                        <td width="25%">E-mail: </td>
                        <td><input type="text" id="f_input" name="email" size="55" /></td>
                    </tr>
                    <tr>
                        <td width="25%">New password: </td>
                        <td><input type="password" id="f_input" name="newpassword" /></td>
                    </tr>
                    <tr>
                        <td width="25%">Repeat new password: </td>
                        <td><input type="password" id="f_input" name="repeatnewpassword" /></td>
                    </tr>
                    <tr>
                        <td colspan="2"><br><input type="submit" id="f_submit" name="signup" value="Sign up" /></td>
                    </tr>
                </form>
            </table>
            </fieldset>
        </li>
    </ul>
</div>
<script type="text/javascript" language="javascript">
    document.signupform.name.focus();
</script>
<?
    } else {
        print "<script language='javascript'>
            window.location.href='./';
            </script>";
    }
?>
